(require 'init-custom)
(require 'init-funcs)

;; Set ELPA packages
;; 默认为 emacs-china
(set-package-archives custom-package-archives nil nil t)

;; 初始包管理器
(unless (bound-and-true-p package--initialized) ; To avoid warnings in 27
  (setq package-check-signature nil)   ;; 个别时候会出现签名检验失败
  (setq package-enable-at-startup nil)          ; 防止初始化2次
  (package-initialize))

;;quelpa 直接从源代码动态构建和安装Emacs Lisp包
;; add quelpa support
(use-package quelpa
  :ensure t
)

(unless (package-installed-p 'quelpa-use-package)
  (quelpa
    '(quelpa-use-package
      :fetcher git
      :url "https://github.com/quelpa/quelpa-use-package.git")))

(use-package quelpa-use-package
  :init
  (setq quelpa-use-package-inhibit-loading-quelpa t)
  :demand t)

(provide 'init-package)